<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>本地文件浏览器</title>
    <link rel="stylesheet" href="Server.css" />
    <link rel="stylesheet" href="Server_Nav.css" />
    <link rel="stylesheet" href="Server_Header.css" />
  </head>
  <body>
    <!-- 导航栏 -->
    <div class="navbar">
      <div class="nav-item">对局管理</div>
      <div class="nav-item">团队管理</div>
      <div class="nav-item active">服务器配置</div>
      <div class="nav-item">插件管理</div>
    </div>

    <div class="header-container">
      <div class="header">
        <h1 class="header-title">服务器配置</h1>
        <p class="header-subtitle">访问服务器后台目录进行配置</p>
      </div>
    </div>

    <!-- 主内容区 -->

    <div class="file-explorer">
      <!-- 目录树 -->
      <div class="directory-tree" id="directoryTree">
        <div class="directory-header">
          <p>请选择目录开始浏览</p>
          <button onclick="openDirectory()">选择目录</button>
        </div>
        <div class="tree-items-container" id="treeItemsContainer"></div>
      </div>

      <!-- 文件内容区域 -->
      <div class="file-content" id="fileContent">
        <div class="path-navigation">
          <button onclick="goUpDirectory()">← 上一级</button>
          <input
            type="text"
            class="path-input"
            id="currentPath"
            value="/"
            onkeypress="handlePathInputKeyPress(event)"
          />
        </div>

        <div class="file-actions">
          <button onclick="createNewFile()">新建文件</button>
          <button onclick="createNewFolder()">新建文件夹</button>
          <button onclick="deleteSelected()">删除</button>
          <button onclick="saveFile()">保存</button>
        </div>

        <div class="content-area" id="contentArea">
          <p>请从左侧选择文件或文件夹</p>
        </div>
      </div>
    </div>

    <input type="file" id="fileInput" webkitdirectory directory multiple />

    <script src="server.js"></script>
  </body>
</html>
